<!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <title>结算记录-{$webname}</title>
    {Model_Supplier::css("style.css,base.css,extend.css",'brokerage')}
    {Common::js("jquery.min.js")}
    <script src="/plugins/supplier_brokerage/public/js/laydate/laydate.js"></script>
    <link type="text/css" href="/supplier/public/pc/css/supplier_back.css" rel="stylesheet"/>
    <style>
        .notes-list li{
            color: #565656;
            margin: 10px 0;
        }
    </style>
</head>

<body top_margin=NAVX4t >
<div class="supplier-main-block">
    <div class="content-box">
        <div class="cw-table clearfix">
            <table width="100%" border="0">
                <thead>
                <tr id="record_list_header">
                    <th>分销渠道</th>
                    <th>待结算金额</th>
                    <th>已结算金额</th>
                    <th>总金额</th>
                    <th>操作</th>
                </tr>
                </thead>
                <tbody>
                <?php
                $ToBeSettled = 0;
                $Settled = 0;
                $TotalPrice = 0;
                ?>
                {loop $channel $k $v}
                <?php
                $ToBeSettled = bcadd($ToBeSettled,$v['commission']['settled'],2);
                $Settled = bcadd($Settled,$v['commission']['unsettled'],2);
                $TotalPrice = bcadd($TotalPrice,$v['commission']['total_price'],2);
                ?>
                <tr>
                    <td>{$v['title']}</td>
                    <td>{Currency_Tool::symbol()}{$v['commission']['unsettled']}</td>
                    <td>{Currency_Tool::symbol()}{$v['commission']['settled']}</td>
                    <td>{Currency_Tool::symbol()}{$v['commission']['total_price']}</td>
                    <td>
                        <a href="/supplier_brokerage?channel_id={$v['id']}" class="operation-btn">结算记录</a>
                    </td>
                </tr>
                {/loop}
                <tr>
                    <td>合计</td>
                    <td>{Currency_Tool::symbol()}{$Settled}</td>
                    <td>{Currency_Tool::symbol()}{$ToBeSettled}</td>
                    <td>{Currency_Tool::symbol()}{$TotalPrice}</td>
                    <td></td>
                </tr>
                </tbody>
            </table>
            <div>
                <ul class="notes-list">
                    <li>待结算金额：订单已支付，状态为未完成的金额</li>
                    <li>已结算金额：订单状态已完成的结算金额</li>
                    <li>结算总金额：待结算金额 + 已结算金额</li>
                </ul>
            </div>
        </div>
    </div>
</div>
</body>
</html>